<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="__PUBLIC__/static/home/css/bootstrap.min.css" type="text/css" rel="stylesheet">
    <script src="__PUBLIC__/static/home/js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="__PUBLIC__/static/layer/layer.js"></script>
    <title>下载</title>
</head>
<body>
<form id="replayMsgForm" method="post" class="form-inline" action="">
    <div class="modal-body">

        <div class="comment-title">
            <div class="form-group">
                <label for="commentName">验证：</label>
                <input type="text" name="code" placeholder="验证码" maxlength="4" class="form-control" id="replaycode">
            </div>
            <div class="form-group">
                <img style="display: inline;border: 1px solid #ccc;" src="__CONTROLLER__/verify" class="comment-form-text"  onclick="this.src='__CONTROLLER__/verify/'+Math.random()" id="verifyImg" style="height: 34px">
                <span style="line-height: 34px;    margin-left: 10px;">点击图片切换</span>
                <button type="submit" class="btn btn-primary">提交更改</button>
            </div>

        </div>
    </div>
</form>
<p style='margin-left:20px;font-size:12px;color:#bcf'>压缩包过大，请耐心等待......下载次数：{:F('num')['num']}次</p>
</body>
<script>
    $("#replayMsgForm").submit(function(){
        var replaycode=$.trim($("#replaycode").val());
        if(replaycode==''){
            layer.msg('验证码不能为空');
            return false;
        }
        $.post('{:U("__CONTROLLER__/down")}',{'code':replaycode},function(res){
            if(res.status==1){
                $("#replayMsgForm").hide();
                window.parent.location.href='{:U("__CONTROLLER__/downzip")}';
                window.parent.layer.closeAll();
            }else{
                layer.msg(res.msg);
            }
        });
        return false;
    });

</script>
</html>